package com.fastjars.business.shiro.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fastjars.business.shiro.session.SessionStatus;

import java.io.Serializable;
import java.util.Date;

/**
 * UserOnline
 *
 * @author Brant Liu <br> 邮箱：<br>lbf1988@qq.com <br>日期：<br>2018/06/05
 * @version 1.0.0
 */
public class UserOnline extends UserModel implements Serializable {
    private String sessionId;

    private String host;

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date lastAccess;

    private long timeout;

    private byte sessionStatus = SessionStatus.SESSION_STATUS_ONLINE;

    public UserOnline() {
    }

    public UserOnline(UserModel subject){
        super(subject);
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getLastAccess() {
        return lastAccess;
    }

    public void setLastAccess(Date lastAccess) {
        this.lastAccess = lastAccess;
    }

    public long getTimeout() {
        return timeout;
    }

    public void setTimeout(long timeout) {
        this.timeout = timeout;
    }

    public byte getSessionStatus() {
        return sessionStatus;
    }

    public void setSessionStatus(byte sessionStatus) {
        this.sessionStatus = sessionStatus;
    }
}
